#pragma once

#include "GraphCut.h"

namespace GraphCutLib
{

	struct NodeData 
	{
		bool operator < (const NodeData& nodeData) const
		{
			return nodeIndex < nodeData.nodeIndex;
		}

		static	NodeData	getData(int w,int h,int size)
		{
			NodeData data;
			data.wIndex = w;
			data.hIndex = h;
			data.nodeIndex = h * size + w;

			return data;
		}

		static bool			isValid(int w,int h,int size)
		{
			if(w < 0 || h < 0 || w >= size || h >= size)
				return false;
			return true;
		}

		//for log
		std::string	getLogStr();

		int		wIndex;
		int		hIndex;
		int		nodeIndex;
		int		value;
	};

	class CellScene;

	class EdgeWeightBase
	{
	public:

		virtual	float		getEdgeWeight(const NodeData& startNode,const NodeData& endNode) = 0;

	protected:
	private:
	};

	class GeneratorGraph
	{
	public:
	
		GeneratorGraph(){}

		static void	generatorGraph(Graph<NodeData>&	graph,CellScene& cellScene,EdgeWeightBase* edgeWeightGen = 0);

	protected:

	private:
	};
}